import { Util } from "../../utils/Util";

const { ccclass, property } = cc._decorator;

@ccclass
export default class TixianJIluItem extends cc.Component {

    @property(cc.Label)
    time: cc.Label = null;

    @property(cc.Label)
    money: cc.Label = null;

    @property(cc.Label)
    state: cc.Label = null;

    // onLoad () {}

    start() {

    }

    registerTouch() {
        this.node.on(cc.Node.EventType.TOUCH_START, this.touchstart, this);
        this.node.on(cc.Node.EventType.TOUCH_END, this.touchend, this);
    }

    public touchstart() {

    }

    public touchend() {

    }

    setData(data) {
        this.node.active = true;
        // this.time.string = Util.convertTimestampToDateTime(parseInt(data.price_time));
        this.time.string = data.time;
        this.money.string = "收益：" + data.money;
        let state = ["提现中","提现成功","提现失败","待支付","支付中"];
        this.state.string = state[Number(data.status)];
    }

    // update (dt) {}
}
